@isTest
private class Cbl_ServicePlanToCase_Test {

    static testMethod void myUnitTest() {
        Id engProfile = [Select Id From Profile Where Name ='工程部工程师'].Id;
        User u1 = new User( Alias = 'samLdc1', 
                         Email = 'ldc@test.com.maike',
                         Emailencodingkey = 'UTF-8', 
                         Lastname = '用户1', 
                         Languagelocalekey = 'en_US',
                         Localesidkey = 'en_US', 
                         Profileid = engProfile, 
                         Country = 'United States',
                         IsActive = true,
                         FederationIdentifier = '3451',
                         CompanyName = 'Y-MKSY',
                         SubCompany__c='四川省迈克实业有限公司',
                         UserDepartment__c='客户服务中心(工程部)',
                         Timezonesidkey = 'America/Los_Angeles', 
                         EmployeeNumber = '123451',
                         ManagerId = UserInfo.getUserId(),
                         Username = 'Matldc1@test.com.maike' );
        
        
        User u2 = new User( Alias = 'samLdc2', 
                Email = 'ldc@test.com.maike',
                Emailencodingkey = 'UTF-8', 
                Lastname = '用户2', 
                Languagelocalekey = 'en_US',
                Localesidkey = 'en_US', 
                Profileid = engProfile, 
                Country = 'United States',
                IsActive = true,
                FederationIdentifier = '3452',
                CompanyName = 'Y-MKSY',
                 ManagerId = UserInfo.getUserId(),
                UserDepartment__c='客户服务中心(工程部)',
                Timezonesidkey = 'America/Los_Angeles', 
                EmployeeNumber = '123452',
                Username = 'Matldc2@test.com.maike' );

        insert u1;
        insert u2;

        
        Account acc=TestUtils.createAccount();
        acc.Level__c = '一级医院';
        insert acc;
        
        // Order__c ord=new Order__c();
        // ord.Account__c=acc.Id;
        // ord.Created_Date__c=Date.today();
        // insert ord;
        
        // Product__c pt=new Product__c();
        // pt.Name='testPtName';
        // insert pt;
        
        // Price__c pr=new Price__c();
        // pr.Product__c=pt.Id;
        // pr.Company__c='四川省迈克实业有限公司';
        // insert pr;
        
        // Order_Product__c odp=new Order_Product__c();
        // odp.Name='testPtName';
        // odp.Order__c=ord.Id;
        // odp.Company__c='四川省迈克实业有限公司';
        // insert odp;
         
        ServicePlan__c sp=new ServicePlan__c();
        sp.Account__c=acc.Id;
        sp.January__c=true;
        sp.February__c=true;
        sp.March__c=true;
        sp.April__c=true;
        sp.May__c=true;
        sp.June__c=true;
        sp.July__c=true;
        sp.August__c=true;
        sp.September__c=true;
        sp.October__c=true;
        sp.November__c=true;
        sp.December__c=true;
        sp.Owner__c='samLdc1';
        sp.InsertType__c='工程师';
        sp.Servicetype__c = '工程';
        sp.EmployeeNumber__c='123451';
        sp.EmployeeNumbergc__c = '123452';
        insert sp;

        sp.EmployeeNumber__c='123452';
        update sp;

        // sp = [select Owner__c from ServicePlan__c where Id = :sp.Id];
        // System.assertEquals('samLdc2', sp.Owner__c);

        User u = [select Id from User where Alias = 'samLdc2'];

       
    }
}